<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of PyramidUCAction
 *
 * @author Alen
 */
class PyramidUCAction extends PyramidAction {
    //put your code here
    protected $USER;
    public function __construct() {
        parent::__construct();        
        $this->check_user_login();
        if(!$this->dm) $this->dm=new SoDataModule();
        $this->USER=$this->dm->select_one_row('tusermember', 'UserName=\''.$this->USER_NAME.'\'');
        if(!$this->USER) redirect ('账户不存在','?m=Login');
        $this->assign('IS_Agent', $this->USER['IsAgent']);
                
    }
    
    /**
     * 检测交易密码
     * @param type $urlsuccess
     * @param type $urlfail
     * @since 1.0.0 2013-12-18 sutroon
     */
    public function check_tradepassword($urlsuccess='',$urlfail=''){
        if(!request_string('Password')) redirect('密码未填写',$urlsuccess);	
	if(request_string('Password') != $this->USER['TradePassword']) redirect('密码错误',$urlfail);
	$_SESSION['tradepwd']='true';
        redirect('密码正确!',$urlsuccess);
    }
}

?>
